#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int n, m, q;
int x[N], y[N];
vector<int> a[N];
map<int, pii> pos[N];
int ans[N];
bool cmp(int i, int j) { return y[i] < y[j]; }

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> m;
  rep(i, 1, n) cin >> x[i] >> y[i];
  rep(i, 1, n) a[x[i]].push_back(y[i]);
  rep(i, 1, m) sort(a[i].begin(), a[i].end());
  int len = n;
  rep(i, 1, m) len = min(len, (int)a[i].size());
  rep(i, 1, len) rep(j, 1, m) ans[i] = max(ans[i], a[j][i - 1]);
  cin >> q;
  while (q--) {
    int t, id;
    cin >> t >> id;
    int c = x[id];
    int r = y[id];
    int pos = lower_bound(a[c].begin(), a[c].end(), r) - a[c].begin() + 1;
    if (pos <= len && t >= ans[pos])
      cout << "No" << endl;
    else
      cout << "Yes" << endl;
  }
  return 0;
}